@extends('layouts.app')

@section('content')
    <section class="content-header">
        <h1 class="pull-left">商品列表</h1>


        <div class="" style="clear: both">
            {!! Form::open(['route' => 'goods.index','method'=>'GET']) !!}
            {{--{!! Form::label('', '选择订单状态:') !!}--}}
            <input type="text" name="title" value="{{ (isset($request['title'])&&$request['title'])?$request['title']:'' }}" placeholder="搜索名称或者货号">
            <input type="text" name="texture" value="{{ (isset($request['texture'])&&$request['texture'])?$request['texture']:'' }}" placeholder="搜索材质">
            <input type="text" name="technology" value="{{ (isset($request['technology'])&&$request['technology'])?$request['technology']:'' }}" placeholder="搜索工艺">
            <select name="cate_id" id="cate">
                <option value="">选择大类</option>
                @foreach($cates as $cate)
                    <option value="{{$cate->id}}" {{ (isset($request['cate_id'])&&$request['cate_id']==$cate->id)?'selected':'' }}>{{$cate->title}}</option>
                @endforeach
            </select>
            {!! Form::submit('搜索', ['class' => 'btn btn-primary']) !!}
            {!! Form::close() !!}
        </div>

        <h1 class="pull-right">
           <a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{!! route('goods.create') !!}">添加</a>
        </h1>
    </section>
    <div class="content">
        <div class="clearfix"></div>

        @include('flash::message')

        <div class="clearfix"></div>
        <div class="box box-primary">
            <div class="box-body">
                    @include('goods.table')
            </div>
        </div>
    </div>
    <?php
    if(!isset($request))
        $request = request()->all();
    ?>
    {{ $goods->appends($request)->links() }}
@endsection
